The dataset contains the code (python, in .py) and the data (.xlsx or .shp) used for the techo economic model described in the paper.
The .xlsx file contains information about food waste producer (location, amount, and type of waste) and about yields and product composition from HTC experiments with food waste.
The .shp files contains the geometrical description of US states, boundaries, natural barriers, etc.

Requirements to run the script:
The script is OS independent, so it should run on Windows, MacOS, Linux -
Python 3.10.2 or later has to be installed (however, pyhton version 3.10 avoids issues related to the geopandas installation, but that may have been solved)
Packages to be installed: numpy, pandas, matplotlib, seaborn, pathlib, datetime, itertools, geopandas
Download and unzip the folder.
The folder may need to be added to the python PATH.
Run the script (runtime in the order of seconds-minutes depending on system performance)
The script loads the original xlsx. files with HTC (hydrothermal carbonization) data and the .shp for USA state shapes data and performs all the computations required by the analysis.
The plot used in the manuscript (and many more for the reader convenience) are generated in the output folder (created by the script itself on the first run).

A list of the functions and classes the code uses is provided here (for each one of them, a complete description is provided in the script through docstrings and comments):
Defined classes:
1.	parameter: used to handle parameters for computation and plotting
2.	variable: used to collect variables information inside the same object
Defined functions 
1.	PathCreate: used to create OS independent path to access input and output folders.
2.	FigCreate: used to produce plots with replicable characteristics.
3.	FigSave: in combination with FigCreate and allow customizations before saving the outcomes
4.	latlongdist: calculates the distance [km] between two points given their latitude and longitude coordinates using Haversine formula.
5.	fw_plot: creates a NYS map with food waste distribution and major city locations. Data about food waste producers and NYS boundaries are imported from the input folder.
6.	single_location: given a location (latitude and longiture), this fucntion computes the tecno-economic performance of a hypothetical biorefinery converts food waste into hydrochar through hydrothermal carbonization. Food waste is allocated based on a minimum waste ton/week production and the distance between the producer and the biorefinery.
7.	multi_location: given a list of locations, minimum food waste production, maximum distance from the biorefinery, HTC temperatures, and HTC residence time, for all possible combinations of such parameters this function computes the tecno-economic performance of a biorefinery using the single_location function.
8.	best_locs_select: given as input the dataframe results from the multi_location function, this function selects the best n_best location based on the maximization or minimization of the choice_var. Best locations are selected so that a minimum distance of min_dist_best is always present to ensure every food waste producer has only one location to redirect their food waste.
9.	grid_plot: used to make plots using the results from multi_location and best_locs_select funtions. Results are presented as a geo-localized colormap.
10.	sensitivity_plot: used to produce plots that describe the results for a single location. The simultaneous effect of several variables for the considered location can be represented.
best_locs_trends: computes and plots the cumulative results for n_best best locations as a function of the number of best locations selected (n_best).
